package com.icbc.dccsh.logpumper;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.icbc.dccsh.bootstrap.Bootstrap;
import com.icbc.dccsh.reader.RedisReader;

public class LogpumperApp {
	public static final Logger LOG = LoggerFactory.getLogger(LogpumperApp.class);
	
	public static void main(String[] args) {
		try {
			XMLConfiguration xmlconfig = new XMLConfiguration("conf.xml");
			String bootstrapName = xmlconfig.getString("bootstrap");
			Class testClass = Class.forName(bootstrapName);
			Bootstrap bootstrap = (Bootstrap) testClass.newInstance();
			IConfigurable configurable = (IConfigurable) bootstrap;
			configurable.parseConfig();
			configurable.initialize();
			bootstrap.boot();
		} catch (Exception e) {
			LOG.error(e.toString());
		}
	}
}
